/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package samoloty.view;

import java.awt.Color;
import java.awt.Dimension;
import java.awt.Font;
import javax.swing.JComboBox;
import javax.swing.JScrollBar;
import javax.swing.JScrollPane;
import javax.swing.JViewport;
import javax.swing.ScrollPaneConstants;
import javax.swing.plaf.basic.BasicComboPopup;

/**
 *
 * @author borysfan
 */
public class MyComboPopup extends BasicComboPopup{
    public MyComboPopup(JComboBox box){
        super(box);
    }

    @Override
    protected JScrollPane createScroller(){
        JScrollPane pane = new JScrollPane(list,ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED,ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
        pane.setBackground(MyColors.getBlack());

        for(int i=0;i<pane.getComponents().length;i++){
            pane.getComponent(i).setBackground(Color.red);
          
        }
        JScrollBar scroll = pane.getVerticalScrollBar();
        scroll.setBackground(MyColors.getBlack());
        scroll.setForeground(Color.red);
        for(int i=0;i<scroll.getComponents().length;i++){
            scroll.getComponent(i).setBackground(MyColors.getBlack());
        }

        return pane;
    }
}
